from django.contrib import admin

# Register your models here.
from django.contrib import admin
from .models import Category, TrashItem, SearchHistory, Favorite, Article, Feedback

@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
    list_display = ('name', 'description')

@admin.register(TrashItem)
class TrashItemAdmin(admin.ModelAdmin):
    list_display = ('name', 'category', 'alias')
    search_fields = ('name', 'alias')

@admin.register(SearchHistory)
class SearchHistoryAdmin(admin.ModelAdmin):
    list_display = ('user', 'keyword', 'searched_at')
    list_filter = ('searched_at',)

@admin.register(Favorite)
class FavoriteAdmin(admin.ModelAdmin):
    list_display = ('user', 'trash_item', 'added_time')

@admin.register(Article)
class ArticleAdmin(admin.ModelAdmin):
    list_display = ('title', 'author', 'created_at')
    search_fields = ('title', 'content')

@admin.register(Feedback)
class FeedbackAdmin(admin.ModelAdmin):
    list_display = ('user', 'submitted_at', 'is_resolved')
    list_filter = ('is_resolved',)
